From e708411be650e2b464861e896170720de0226663 Mon Sep 17 00:00:00 2001 From: Johannes Hoff Date: Sat, 7 Nov 2015 19:36:06 -0800 Subject: [PATCH] Add dependency header in default Cargo.toml Almost any project beyond "hello world" will have some dependencies. Including the `[dependencies]` header by default makes this slightly simpler. For new users of the language, this can potentially save some frustration since crates.io currently does not mention the header, just the line that goes beneath it. For all users, this makes adding the first dependency to a project less of a special case than to subsequent dependencies. --- src/cargo/ops/cargo_new.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/cargo/ops/cargo_new.rs b/src/cargo/ops/cargo_new.rs index c3a6e5acb..41f831866 100644 --- a/src/cargo/ops/cargo_new.rs +++ b/src/cargo/ops/cargo_new.rs @@ -147,6 +147,8 @@ r#"[package] name = "{}" version = "0.1.0" authors = [{}] + +[dependencies] "#, name, toml::Value::String(author)).as_bytes())); try!(fs::create_dir(&path.join("src"))); -- 2.30.2